<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li v-for="itme in list" :key="itme.id" :class="{ completed: itme.isDone }">
      <div class="view">
        <input v-model="itme.isDone" class="toggle" type="checkbox" />
        <label>{{ itme.name }}</label>
        <button @click="cancel(itme.id)" class="destroy"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ["list"],
  methods: {
    cancel(id) {
      this.$emit("cancelTack", id);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>